<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.selectWidth2{
   width:205px;
}
</style>


<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">合同基本信息</div>
<table class="t_css table01" width="100%" border="0" cellpadding="0"
	cellspacing="1">
	<col style="width:20%"/>
	<col style="width:22%"/>
	<col style="width:17%"/>
	<col style="width:18%"/>
	<col style="width:23%"/>
							<tr>
								<td nowrap>
									<span class="color_red">*</span>【项目名称】
								</td>
								<td colspan="4">
									<input type="text" class="required" label="项目名称" name="proposal/zh_title" style="width:93%" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title"/>">
								</td>
								
							</tr>
							<tr>
								<td nowrap>
									<span class="color_red">*</span>【登记机构】
								</td>
								<td colspan="2">
			  <c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/recommend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recommend_org_name" />'}</c:set>
          	<c:if test="${ empty bulu }">
          	<cpt:tree key="jshtdjjg" cacheable="false" className="hn_iuput_kuang" readonly="false" value="${subject}"  label="登记机构"
          		id="recommend_org" showPattern="current" shieldPattern="0"   topCheckbox ="true" onlyChooseLeaf = "false" onClick="initTreeValue2" />
          	</c:if>
          	<c:if test="${not empty bulu and bulu == 'bulu'}">
          		<input type= "text" value = "<x:out select="$xmlData/data/proposal/recommend_org_name" />" />
          	</c:if>
	        <input id="recommend_org_code" type="hidden" name="proposal/recommend_org_value" class="required" label="登记机构" value="<x:out select="$xmlData/data/proposal/recommend_org_value" />"/>
            <input id="recommend_org_name" type="hidden" name="proposal/recommend_org_name"  value="<x:out select="$xmlData/data/proposal/recommend_org_name" />"/>
								 
								</td>
									<td nowrap>
									<span class="color_red">*</span>【登记员】
								</td>
								<td colspan="1">
							
								<select name="recommend_org_person" id="institutionPerson" style="width:170px" onChange="initControlValue(this.id);" >
									<option value=""></option>
								</select>
									<input type="hidden" id="institutionPerson_name" name="proposal/recommend_org_person_name"  label="登记员"  class="required"  value="<x:out select="$xmlData/data/proposal/recommend_org_person_name"/>" />
								   <input type="hidden" id="institutionPerson_value" name="proposal/recommend_org_person_value"   value="<x:out select="$xmlData/data/proposal/recommend_org_person_value"/>" />
								</td>
							</tr>
							<tr><%-- <td><span class="color_red">*</span>【合同编号】</td>
								<td colspan="2"><input type="text" name="proposal/contract_no" onfocus="InitInput.setInt(this,16)" label="合同编号"  class="required minlength:16" maxlength="16" value="<x:out select="$xmlData/data/proposal/contract_no"/>"></td>
								 --%>
								 <td nowrap>
									<span class="color_red">*</span>【支付方式】
								</td>
								<td colspan="2">
						
													<c:set var="val">
								<x:out select="$xmlData/data/proposal/pay_way_value" />
							</c:set> <cpt:select id="pay_way" style="width:170px" key="tech_ctr_pay_method"
								onChange="initControlValue(this.id);" value="${val}"
								className="hn_iuput_kuang100"></cpt:select> <input type="hidden"
							name="proposal/pay_way_value" class="required" id="pay_way_value"
							value="<x:out select="$xmlData/data/proposal/pay_way_value" />"
							label="支付方式" /> <input type="hidden" name="proposal/pay_way_name"
							value="<x:out select="$xmlData/data/proposal/pay_way_name" />" />
								</td>						
									<td nowrap>
									<span class="color_red">*</span>【是否关联交易】
								</td>
								<td>
									<c:set var="val">
								<x:out select="$xmlData/data/proposal/is_link_seller_value" />
							</c:set> <cpt:select id="is_link_seller" style="width:170px" key="tech_yesno"
								onChange="initControlValue(this.id);" value="${val}"
								className="hn_iuput_kuang100"></cpt:select> <input type="hidden"
							name="proposal/is_link_seller_value" class="required" id="is_link_seller_value"
							value="<x:out select="$xmlData/data/proposal/is_link_seller_value" />"
							label="是否关联交易" /> <input type="hidden" name="proposal/is_link_seller_name"
							value="<x:out select="$xmlData/data/proposal/is_link_seller_name" />" />
								
								
								</td>
							</tr>
							<tr >
								<td nowrap>
									<span class="color_red">*</span>【合同成交总金额】
								</td>
								<td colspan="2">
									<input type=text style="text-align: right" class="required" label="合同成交总金额"  onfocus="InitInput.setNumber(this,6,6,4);" name="prp_base_info/total_amt1" id="total_amt1" value="<x:out select="$xmlData/data/prp_base_info/total_amt1"/>"  decimalPlaces=0 style="width: 150" ></input>&nbsp;万元
								</td>
							<!-- 	<td rowspan=2 width="200px"><font color=red style="font-weight:bold"> 注：合同成交额、交易额只精确到“元”，是其它币种时请折算成人民币（以填写本申请时的汇率折算），并在提交纸质材料时附相关说明。</font>
								</td> -->
							<td nowrap>
									<span class="color_red">*</span>【其中：技术交易额】
								</td>
								<td colspan="1">
									<input type=text class="required valueCompare:technology:total_amt1" label="其中：技术交易额" style="text-align: right" onfocus="InitInput.setNumber(this,6,6,4)" name="prp_base_info/technology" id="technology" value="<x:out select="$xmlData/data/prp_base_info/technology"/>"   decimalPlaces=0 style="width: 150" ></input>&nbsp;万元
									
								</td>
							</tr>
							<tr>
								<td nowrap>
									<span class="color_red">*</span>【合同签订日期】
								</td>
								<td  colspan="2">
											<c:set var="judgement_date" ><x:out select="$xmlData/data/contract/judgement_date" /></c:set>
										<cpt:date id="judgement_date" name="contract/judgement_date"
												value="${judgement_date}" className="required date dateCompareBeforeE:judgement_date:sign_date" label="合同签订日期"></cpt:date>
										
								</td>
								<td nowrap >
									<span class="color_red">*</span>【合同登记日期】
								</td>
								<td >
									<c:set var="sign_date" ><x:out select="$xmlData/data/contract/sign_date" /></c:set>
									 
										<cpt:date id="sign_date" name="contract/sign_date"
												value="${sign_date}" className="required date" label="合同登记日期"></cpt:date>
										
								</td>
								
							
							</tr>
							<tr>
							
								<td nowrap>
									<span class="color_red">*</span>【合同起始日期】
								</td>
								<td colspan="2">
								<c:set var="start_date" ><x:out select="$xmlData/data/contract/start_date" /></c:set>
										<cpt:date id="start_date" name="contract/start_date"
												value="${start_date}" className="required date" label="合同起始日期"></cpt:date>
								</td>
							
								<td nowrap>
									<span class="color_red">*</span>【合同结束日期】
								</td>
								<td>
									<c:set var="end_date" ><x:out select="$xmlData/data/contract/end_date" /></c:set>
									<cpt:date id="end_date" name="contract/end_date"
											value="${end_date}" className="required date dateCompareBeforeE:start_date:end_date" label="合同结束日期"></cpt:date>
								</td>
							</tr>
							
							<tr>
								<td>
									<span class="color_red">*</span>【合同类别】
									
								</td>
								<td colspan='2'>
									<input name="prp_base_info/ctr_type1"
										id="ctr_type1" 
										value="<x:out select="$xmlData/data/prp_base_info/ctr_type1"/>"
										type=text style="width: 360; height: 21" class="required" label="合同类别"
										style="TEXT-ALIGN: center" readonly />
									<a href="#"><IMG border=0
											onclick="xmlSelect('ContractType');"
											src="${res_app}/images/arrow1.gif" width="16" height="16">
									</a>
									<input name="prp_base_info/ctr_type_code"
										id="ctr_type_code" 
										value="<x:out select="$xmlData/data/prp_base_info/ctr_type_code"/>"
										type="hidden"
										style="TEXT-ALIGN: center" readonly />
									<input name="prp_base_info/flag_ctr_type"
										value="<x:out select="$xmlData/data/prp_base_info/flag_ctr_type"/>"
										type="hidden" id="flag_ctr_type"
										/>
								</td>
								<td>
									<span class="color_red">*</span>【技术领域】
									
								</td>
								<td colspan='1'>
									<input name="prp_base_info/tech_area_code"
										id="prp_base_info/tech_area_code"  class="required" label="技术领域"
										value="<x:out select="$xmlData/data/prp_base_info/tech_area_code"/>"
										type=hidden style="width: 230; height: 21"
										style="TEXT-ALIGN: center" readonly />
									<input name="prp_base_info/tech_area1"
										id="prp_base_info/tech_area1"
										value="<x:out select="$xmlData/data/prp_base_info/tech_area1"/>"
										type=text style="width: 360; height: 21"
										style="TEXT-ALIGN: center" readonly />
									<a href="#"><IMG border=0
											onclick="xmlSelect('TechnologyType');"
											src="${res_app}/images/arrow1.gif" width="16" height="16">
									</a>
								</td>
								
							</tr>
							<tr>
								<td>
									<span class="color_red">*</span>【项目计划来源】
									
								</td>
								<td colspan='2'>
									<input name="prp_base_info/plan_source_code"
										id="plan_source_code"  class="required" label="项目计划来源"
										value="<x:out select="$xmlData/data/prp_base_info/plan_source_code"/>"
										type=hidden style="width: 360; height: 21"
										style="TEXT-ALIGN: center" readonly />
									<input name="prp_base_info/plan_source1"
										id="plan_source1"
										value="<x:out select="$xmlData/data/prp_base_info/plan_source1"/>"
										type=text style="width: 360; height: 21"
										style="TEXT-ALIGN: center" readonly />
									<a href="#"><IMG border=0
											onclick="xmlSelect('ProgramType');"
											src="${res_app}/images/arrow1.gif" width="16" height="16">
									</a>
								</td>
							
								<td>
									<span class="color_red">*</span>【知识产权】
									
								</td>
								<td colspan='1'>
									<input name="prp_base_info/kr_no_code"
										id="kr_no_code"  class="required" label="知识产权"
										value="<x:out select="$xmlData/data/prp_base_info/kr_no_code"/>"
										type=hidden style="width: 230; height: 21"
										style="TEXT-ALIGN: center" readonly />
									<input name="prp_base_info/kr_no1" id="kr_no1"
										value="<x:out select="$xmlData/data/prp_base_info/kr_no1"/>"
										type=text style="width: 360; height: 21"
										style="TEXT-ALIGN: center" readonly />
									<a href="#"><IMG border=0 onclick="xmlSelect('KnowType');"
											src="${res_app}/images/arrow1.gif" width="16" height="16">
									</a>
								</td>
							</tr>
							<tr id="zlsl1" style="display:none">
								<td nowrap>
									<span class="color_red">*</span>【含专利数量】
								</td>
								<td colspan=2>
									<input type=text style="text-align: right" onfocus="InitInput.setNumber(this,9,0,0)" label="含专利数量" name="prp_base_info/zlsl" id="zlsl" value="<x:out select="$xmlData/data/prp_base_info/zlsl"/>"  decimalPlaces=0 style="width: 150" maxlength=10></input>&nbsp;个
								</td>
								<td>
									<span class="color_red">*</span>【其中含发明专利数量】
								</td>
								<td>
									<input type=text style="text-align: right" onfocus="InitInput.setNumber(this,9,0,0)" label="其中含发明专利数量"  name="prp_base_info/zlsa" id="zlsa" value="<x:out select="$xmlData/data/prp_base_info/zlsa"/>"  decimalPlaces=0 style="width: 130" maxlength=10></input>&nbsp;个
								</td>
							</tr>
							<tr id="zlsl2" style="display:none">
								<td nowrap>
									<span class="color_red">*</span>【其中含实用新型专利数量】
								</td>
								<td colspan=2>
									<input type=text style="text-align: right" onfocus="InitInput.setNumber(this,9,0,0)" label="其中含实用新型专利数量"  name="prp_base_info/zlsb" id="zlsb" value="<x:out select="$xmlData/data/prp_base_info/zlsb"/>" class="numericIn" decimalPlaces=0 style="width: 150" maxlength=10></input>&nbsp;个
								</td>
								<td nowrap="nowrap">
									<span class="color_red">*</span>【其中含外观设计专利数量】
								</td>
								<td>
									<input type=text style="text-align: right" onfocus="InitInput.setNumber(this,9,0,0)" label="其中含外观设计专利数量"  name="prp_base_info/zlsc" id="zlsc" value="<x:out select="$xmlData/data/prp_base_info/zlsc"/>" class="numericIn" decimalPlaces=0 style="width: 130" maxlength=10></input>&nbsp;个
								</td>
							</tr>
							<tr>
								<td >
									<span class="color_red">*</span>【技术服务的国民经济行业】
								</td>
								<td nowrap colspan='2'>
									<c:set var="val">
								<x:out select="$xmlData/data/proposal/jsfwgmjjhy_value" />
							</c:set> <cpt:select id="jsfwgmjjhy" style="width:170px" key="seller_belong"
								onChange="initControlValue(this.id);" value="${val}"
								className="hn_iuput_kuang100"></cpt:select> <input type="hidden"
							name="proposal/jsfwgmjjhy_value" class="required" id="jsfwgmjjhy_value"
							value="<x:out select="$xmlData/data/proposal/jsfwgmjjhy_value" />"
							label="技术服务的国民经济行业" /> <input type="hidden" name="proposal/jsfwgmjjhy_name"
							value="<x:out select="$xmlData/data/proposal/jsfwgmjjhy_name" />" />
											
								
								</td>
									<input type="hidden" name="prp_base_info@gmjjhy_name" id="prp_base_info@gmjjhy_name"  
										value="<x:out select="$xmlData/data/prp_base_info/@gmjjhy_name"/>">
											<td>
									<span class="color_red">*</span>【社会经济目标】
									
								</td>
								<td colspan="1">
									<c:set var="val">
								<x:out select="$xmlData/data/proposal/target_value" />
							</c:set> <cpt:select id="target" style="width:170px" key="tech_ctr_target_type"
								onChange="initControlValue(this.id);" value="${val}"
								className="hn_iuput_kuang100"></cpt:select> <input type="hidden"
							name="proposal/target_value" class="required" id="target_value"
							value="<x:out select="$xmlData/data/proposal/target_value" />"
							label="社会经济目标" /> <input type="hidden" name="proposal/target_name"
							value="<x:out select="$xmlData/data/proposal/target_name" />" />
											
						
								</td>
							</tr>
							<tr style="display:none" id="reg_no1">
							
									<td nowrap>
									<span class="color_red">*</span>【课题立项名称】
								</td>
								<td colspan="4">
									<input type="text" id="sub_name" name="prp_base_info/sub_name" label="课题立项名称" maxlength="100" style="width:39%" value="<x:out select="$xmlData/data/prp_base_info/sub_name"/>">
								</td>	
								
							</tr>
						
						
							<tr style="display:none" id="reg_no2">
							<td nowrap>
									<span class="color_red">*</span>【课题立项编号】
								</td>
								<td colspan="2">
									<input type="text" maxlength="12" id="sub_code" label="课题立项编号"  name="prp_base_info/sub_code"   value="<x:out select="$xmlData/data/prp_base_info/sub_code"/>">
								</td>
								<td nowrap="nowrap">
								
									【科技成果登记部门批准登记号】
								</td>
								<td >
									<input type=text name="prp_base_info/reg_no" id="reg_no"  maxlength="12" label="科技成果登记部门批准登记号"
										value="<x:out select="$xmlData/data/prp_base_info/reg_no"/>"
										 ></input>
								</td>	
								
							</tr>
</table>
<script type="text/javascript">
$(function(){
	var programType=$("#plan_source_code").val().substr(0,4);
	if(programType=='0101'){
		$("#reg_no1").css('display','');
		$("#reg_no2").css('display','');
		$("#sub_name").addClass("required");
		$("#sub_code").addClass("required");
		$("#sub_code").addClass("minlength:12");
		//$("#reg_no").addClass("required");
	}else{
		$("#reg_no1").css('display','none');
		$("#reg_no2").css('display','none');
		$("#sub_name").removeClass("required");
		$("#sub_code").removeClass("required");
		$("#sub_code").removeClass("minlength:12");
		//$("#reg_no").removeClass("required");
		$("#sub_name").val('');
		$("#sub_code").val('');
		$("#reg_no").val('');
	}
	var knowType=$("#kr_no_code").val().substr(0,4);
	if(knowType=='0402'){
		$("#zlsl1").css('display','');
		$("#zlsl2").css('display','');
		$("#zlsl").addClass("required");
		$("#zlsa").addClass("required");
		$("#zlsb").addClass("required");
		$("#zlsc").addClass("required");
		
	}else{
		$("#zlsl1").css('display','none');
		$("#zlsl2").css('display','none');
		$("#zlsl").removeClass("required");
		$("#zlsa").removeClass("required");
		$("#zlsb").removeClass("required");
		$("#zlsc").removeClass("required");
		$("#zlsl").val('');
		$("#zlsa").val('');
		$("#zlsb").val('');
		$("#zlsc").val('');
}
	var recommend_org_value=$("#recommend_org_code").val();
	if(recommend_org_value.length!=0){
		 $.ajax({
				url:"${ctx}/tech-ctr/findInstitutionPerson",
				data:"offOrgCode="+recommend_org_value,
				dataType:"json",
				success:function(msg){
					 if(msg!=null&&msg!=""){
						 $("#institutionPerson").find("option").remove();
						 $("#institutionPerson").append("<option value=''></option>"); 
						 for(var i=0;i<msg.length;i++){
							 if($("#institutionPerson_value").val()==msg[i].psnCode){
								 $("#institutionPerson").append("<option value='"+msg[i].psnCode+"' selected='selected'>"+msg[i].zhName+"</option>"); 
							 }else{
								 $("#institutionPerson").append("<option value='"+msg[i].psnCode+"'>"+msg[i].zhName+"</option>"); 
							 }						
						 }	
					}else{
						$("#institutionPerson").find("option").remove();
						 $("#institutionPerson").append("<option value=''></option>"); 
					}
				}
			}); 
	}
});
function changeInstitution(obj){
	var reisOrgCode=$("#"+obj).val();
	$("#institutionPerson_name").val('');
	$("#institutionPerson_value").val('');
	 $.ajax({
			url:"${ctx}/tech-ctr/findInstitutionPerson",
			data:"offOrgCode="+reisOrgCode,
			dataType:"json",
			success:function(msg){
				 if(msg!=null&&msg!=""){
					 $("#institutionPerson").find("option").remove();
					 $("#institutionPerson").append("<option value=''></option>"); 
					 for(var i=0;i<msg.length;i++){
						 if(msg[i].psnCode == '1090077126'){
							 continue;
						 };
						 $("#institutionPerson").append("<option value='"+msg[i].psnCode+"'>"+msg[i].zhName+"</option>"); 
					 }	
				}else{
					$("#institutionPerson").find("option").remove();
					 $("#institutionPerson").append("<option value=''></option>"); 
				}
			}
		}); 
}


function initTreeValue2(treeId, treeNode) {
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		initTreeValue2CallBack();
		changeInstitution("recommend_org_code");
	}


</script>